﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

namespace JTicket.UI
{
    public partial class S_CheckList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["SeatCode"] != null)
            {
                StringBuilder sb = new StringBuilder();
                string[] Cooke = Request.Cookies["SeatCode"].Value.
                    Replace("G", "").Replace("%7C", ",").TrimEnd(',').Split(',');
                string thcode = Request.QueryString["thCode"].ToString();
                string titlecode = Request.QueryString["titlecode"].ToString();
                string subcode = Request.QueryString["subcode"].ToString();
                string flag = Request.QueryString["flag"].ToString();
                if (Cooke.Count() > 0)
                {
                    if (flag == "1" && Request.QueryString["TaoCode"].ToString().Trim() != "")
                    {
                        string taocode = Request.QueryString["taoCode"].ToString();
                        Model.D_TaoTab taomodel = BLL.D_TaoTab.GetModel(taocode, thcode, titlecode);
                        sb.Append("<tr>");
                        sb.Append("<td align=\"center\" class=\"tt1line\"  bgcolor=\"#F6F6F6\">");
                        sb.Append("<span >1</span></td>");
                        sb.Append("<td align=\"center\" class=\"tt1line\"  bgcolor=\"#F6F6F6\">");
                        sb.Append("<span >" + taomodel.TaoName + "</span></td>");
                        sb.Append("<td align=\"center\" class=\"tt1line\" bgcolor=\"#F6F6F6\">");
                        sb.Append("<span >" + taomodel.TaoPrice + "</span></td>");
                        sb.Append("<td align=\"center\" class=\"tt1line\"  bgcolor=\"#F6F6F6\">");
                        sb.Append("<span >&nbsp;" + Request.QueryString["TaoCount"].ToString() + "</span></td>");
                        sb.Append("<td align=\"center\" class=\"tt1line\" bgcolor=\"#F6F6F6\">");
                        sb.Append("<span>" + taomodel.TaoName + "</span></td>");
                        sb.Append("<td align=\"center\" class=\"tt1line\"  bgcolor=\"#F6F6F6\">");
                        sb.Append("<span>" + taomodel.TaoName + "</span></td> ");
                        sb.Append("<td align=\"center\" class=\"tt1line\" bgcolor=\"#F6F6F6\">");
                        sb.Append("<span>\\</span></td> ");
                        sb.Append("<td align=\"center\" class=\"tt1line\" bgcolor=\"#F6F6F6\">");
                        sb.Append("<span >10.0</span></td>");
                        sb.Append("</tr>");
                    }
                    else
                    {
                        List<Model.D_SubAreaProc> CheckList =
                               BLL.D_SubAreaProc.CheckListGet(thcode, subcode, titlecode, Cooke);
                        for (int i = 0; i <= CheckList.Count - 1; i++)
                        {
                            sb.Append("<tr>");
                            sb.Append("<td align=\"center\" class=\"tt1line\"  bgcolor=\"#F6F6F6\">");
                            sb.Append("<span >" + Convert.ToString(i + 1) + "</span></td>");
                            sb.Append("<td align=\"center\" class=\"tt1line\"  bgcolor=\"#F6F6F6\">");
                            sb.Append("<span >" + CheckList[i].Ticketname + "</span></td>");
                            sb.Append("<td align=\"center\" class=\"tt1line\" bgcolor=\"#F6F6F6\">");
                            sb.Append("<span >" + CheckList[i].Price + "</span></td>");
                            sb.Append("<td align=\"center\" class=\"tt1line\"  bgcolor=\"#F6F6F6\">");
                            sb.Append("<span >1</span></td>");
                            sb.Append("<td align=\"center\" class=\"tt1line\" bgcolor=\"#F6F6F6\">");
                            sb.Append("<span>" + CheckList[i].Row + "</span></td>");
                            sb.Append("<td align=\"center\" class=\"tt1line\"  bgcolor=\"#F6F6F6\">");
                            sb.Append("<span>" + CheckList[i].Cow + "</span></td> ");
                            sb.Append("<td align=\"center\" class=\"tt1line\" bgcolor=\"#F6F6F6\">");
                            sb.Append("<span>" + CheckList[i].Note + "</span></td> ");
                            sb.Append("<td align=\"center\" class=\"tt1line\" bgcolor=\"#F6F6F6\">");
                            sb.Append("<span >10.0</span></td>");
                            sb.Append("</tr>");
                        }

                    }
                }

                lb1.InnerHtml = sb.ToString();
            }
        }
    }
}